<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    // 删除一个元素，从末尾删 pop()  返回被删除的元素
    let arr = [4, 3, 6, 2, 5, 1];
    arr.pop()
    console.log(arr);

    // 删除一个元素，从开头删 shift()  返回被删除的元素
    let arr1 = [4, 3, 6, 2, 5, 1];
    arr1.shift()
    console.log(arr1);

    // 从中间删除不定量元素 splice(开始索引，删除数量)
    let arr2 = [4, 3, 6, 2, 5, 1];
    arr2.splice(2, 3)
    console.log(arr2);
  </script>
</body>

</html>